<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html">
<h:head>
    <title>Редактирование пользователей</title>
</h:head>
<h:body>
    <ui:decorate template="/sampleAdmin.xhtml">
        <ui:define name="content">
            Список всех пользователей :
            <h:form>
                <h:dataTable value="#{admin.users}" var="item"
                             styleClass="order-table"
                             headerClass="order-table-header"
                             rowClasses="order-table-odd-row,order-table-even-row">
                    >
                    <h:column>

                        <f:facet name="header" >
                            <h:outputText value="ID" />
                        </f:facet>
                        <h:outputText value="#{item.id}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Логин:" />
                        </f:facet>
                        <h:outputText value="#{item.login}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Пароль" />
                        </f:facet>
                        <h:outputText value="#{item.pass}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="email" />
                        </f:facet>
                        <h:outputText value="#{item.mail}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Редактирование" />
                        </f:facet>
                        <h:commandButton value="Редактировать" >
                            <f:param name="id_user" value="#{item.id}"/>
                        </h:commandButton>
                        <h:commandButton value="Удалить" action="#{admin.deleteUser}" >
                            <f:param name="id_user" value="#{item.id}"/>
                        </h:commandButton>
                    </h:column>
                </h:dataTable>
            </h:form>


        </ui:define>
    </ui:decorate>










</h:body>
</html>


